package org.example.springtrans.service;

import org.example.springtrans.mapper.LogInfoMapper;
import org.example.springtrans.model.LogInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 九转苍翎
 * Date: 2025/8/3
 * Time: 02:01
 */
@Service
public class LogInfoService {

    @Autowired
    private LogInfoMapper logInfoMapper;

    /*@Transactional(propagation = Propagation.REQUIRED)
    public Integer commit(LogInfo logInfo) {
        return logInfoMapper.insert(logInfo);
    }*/

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public Integer commit(LogInfo logInfo) {
        return logInfoMapper.insert(logInfo);
    }
}
